import { createApp } from "vue";
import { createPinia } from "pinia";
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/dist/index.css";
import "./style.css";
import App from "./App.vue";
import { registerStore } from './store';
import { router } from './router';
import "./utils/flexible";


// import  "./mock/index";
const pinia = createPinia();
const app = createApp(App);
app.use(pinia);
// 注册 Pinia
registerStore()
app.use(router);
app.use(ElementPlus);
// 注册指令
import vdown from '@/directive/vdown';
import vdebounce from '@/directive/debounce';
import vthrottle from '@/directive/throttle';
app.directive('down', vdown)
app.directive('debounce', vdebounce)
app.directive('throttle' , vthrottle)

// Element plus icon 导入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.mount("#app");
